package member.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import member.to.ActionForward;
import member.to.MemberTO;

public class LogoutController implements Controller {
	@Override
	public ActionForward handle(HttpServletRequest request,
			HttpServletResponse response){
		HttpSession session = request.getSession();
		MemberTO mto = (MemberTO)session.getAttribute("login_info");
		if(mto==null){
			request.setAttribute("error_message", "로그인 후 로그아웃 할 수 있습니다. 로그아웃 먼저 하세요");
		}else{
			session.invalidate();
		}
		return new ActionForward("/login_form.jsp", false);
	}

}









